function test1()
    for count = 1, math.huge do
        local line = io.read('L');

        if line == nil then
            break
        end

        io.write(string.format("%6d", count), line);
    end
end

local stream = io.open('d:\\Sources\\Gitee\\monitor\\demo-sources\\lua\\io-demo.lua', 'r');
local index = 1;
while true do
    local line = stream:read('l');

    if line == nil then
        break
    end

    print(index, line);

    index = index + 1;
end

print(stream:read('a'));

stream:close();
